package so.sao.code.service.infrastructure.jpa.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.ProductionRegister;

@Converter(autoApply = true)
public class ProductionRegisterConvert implements AttributeConverter<ProductionRegister, Integer> {

	@Override
	public Integer convertToDatabaseColumn(ProductionRegister attribute) {
		return attribute.getValue();
	}

	@Override
	public ProductionRegister convertToEntityAttribute(Integer dbData) {
		return ProductionRegister.fromValue(dbData);
	}

}
